import 'package:flutter_test/flutter_test.dart';
import 'package:image_picker_huawei/image_picker_huawei.dart';
import 'package:image_picker_huawei/image_picker_huawei_platform_interface.dart';
import 'package:image_picker_huawei/image_picker_huawei_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockImagePickerHuaweiPlatform
    with MockPlatformInterfaceMixin
    implements ImagePickerHuaweiPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final ImagePickerHuaweiPlatform initialPlatform = ImagePickerHuaweiPlatform.instance;

  test('$MethodChannelImagePickerHuawei is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelImagePickerHuawei>());
  });

  test('getPlatformVersion', () async {
    ImagePickerHuawei imagePickerHuaweiPlugin = ImagePickerHuawei();
    MockImagePickerHuaweiPlatform fakePlatform = MockImagePickerHuaweiPlatform();
    ImagePickerHuaweiPlatform.instance = fakePlatform;

    expect(await imagePickerHuaweiPlugin.getPlatformVersion(), '42');
  });
}
